<template>
  <van-form
      ref="form"
      @submit="onSubmit"
    >
      <slot></slot>
  </van-form>
</template>
<script>
export default {
  name: "eagle-form",
  props: {
    url: {
      type: String,
      default: "",
    },
    model: {
      type: Object,
      default() {
        return {};
      },
    },
    isValidate: {
      type: Boolean,
      default: () => true,
    },
  },
  data() {
    return {};
  },
  methods: {
    onSubmit() {
      this.$emit("submitForm");
      // let result = false;
      // if(this.isValidate){
      //     this.$refs.form.validate().then(() => {
      //         result = true;
      //     });
      // }
      // return result;
    },
    onFailed(errorInfo) {
      let aa = errorInfo;
    },
  },
};
</script>
<style lang="less" scoped>
</style>